<template>
	<Modal v-model="modal" title="支付">
		<Form ref="formValidate" :label-width="100">
			<FormItem label='金额:'>
				<Input v-model="money" placeholder="只能输入数字" :maxlength="50" style="width: 65%;" />
			</FormItem>
			

		</Form>
		<div slot="footer">
			<Button type="primary" @click="submit" :loading="loadingBtn">
				<span v-if="!loadingBtn">确定</span>
				<span v-else>请稍候...</span>
			</Button>
			<Button @click="cancel">取消</Button>
		</div>
	</Modal>
</template>

<script>
	import {
		formatDate
	} from '../utils/time.js'
	export default {
		components: {

		},
		data() {
			return {
				modal: false,
				isEdit: false,
				loadingBtn: false,
				isShow: false,
				money: '',
				insideId: '',
				orderNum:'',
			}
		},
		methods: {

			show(res) {
				this.$nextTick(() => {
					this.modal = true
					this.insideId = res.insideId
					this.orderNum = res.orderNum
// 					this.$http.post('maintain/inside/details', {
// 						id: this.insideId
// 					}).then(res => {
// 						if (res.status == 200) {
// 							if (res.data.code == 200) {
// 								console.log(res.data.data);
// 								this.detailsList = res.data.data.detailsList;
// 							}
// 
// 						}
// 
// 					})
				})

			},
			//取消
			cancel() {
				this.modal = false
			},
			modalChange(state) {
				if (state) {

				} else {
					this.$refs.formValidate.resetFields()
				}
			},
			//支付
			submit() {
					let data = {
						money: this.money,
						orderNum: this.orderNum,
						insideId: this.insideId
					}
					this.$http.post('/test/pay', data).then(res => {
						if (res.status == 200) {
							if (res.data.code == 200) {
								this.$Message.success('支付成功')
								this.modal = false
								this.$emit('table')
							}
			
						}
					})
				
			
			
			},
		}
	}
</script>

<style scoped>
	.ivu-form-item {
		margin-bottom: 1px;
	}
</style>
